from .base_model import BaseModel
from django.db import models

class SchoolYear(BaseModel):
    """学年模型"""
    name = models.CharField(max_length=50, verbose_name="学年名称", help_text="例：2023-2024学年")
    start_date = models.DateField(verbose_name="开始日期")
    end_date = models.DateField(verbose_name="结束日期")
    is_current = models.BooleanField(default=False, verbose_name="是否当前学年")

    def __str__(self):
        return self.name

    class Meta:
        verbose_name = "学年"
        verbose_name_plural = "学年"
        ordering = ['-start_date']